﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AddChengben.aspx.cs" Inherits="Admin_AddChengben" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="../css/main-admin.css" rel="stylesheet" type="text/css" />

    <script src="../Jscript/jquery-1.3.2.min.js" type="text/javascript"></script>

    <script src="../Jscript/jquery.ysbnotnull.js" type="text/javascript"></script>

    <script src="../Jscript/page.js" type="text/javascript"></script>

    <script type="text/javascript">


        $(document).ready(function() {

            $("#savebtn").click(function() {


                return $.notnull({ valid: { "figthno": "航空单号", "weightkg": "重量kg", "weightlb": "重量lb", "shourutxt": "收入"


                }
                });
            });

            $("#weightkg").change(function() {
                var value = $("#weightkg").val();
                if ($.trim(value) == "") {

                    alert("重量Kg请输入信息");
                    return;
                }

                if (changeTwoDecimal_f(value) == false) {
                    $("#weightkg").val("");
                    alert("重量Kg请输入数字");
                    return;
                }

                var lb = changeTwoDecimal_f(value) * 2.2;
                var sr = lb * 3;
                $("#weightlb").val(changeTwoDecimal_f(lb));
                $("#shourutxt").val(changeTwoDecimal_f(sr));

            });

            function changeTwoDecimal_f(x) {
                var f_x = parseFloat(x);
                if (isNaN(f_x)) {
                    //   OpenWindow('您输入数字有误，请输入数字' + x);
                    return false;
                }
                var f_x = Math.round(x * 100) / 100;
                var s_x = f_x.toString();
                var pos_decimal = s_x.indexOf('.');
                if (pos_decimal < 0) {
                    pos_decimal = s_x.length;
                    s_x += '.';
                }
                while (s_x.length <= pos_decimal + 2) {
                    s_x += '0';
                }
                return s_x;
            }

        });
    </script>

</head>
<body>

    <script type="text/javascript" src="../DatePicker/WdatePicker.js"></script>

    <form id="form1" runat="server">
    <div class="title">
        成本核算报表</div>
    <div style="float: left; width: 966px; margin-top: 10px;">
        启运地：
 
        <asp:DropDownList ID="selectqiyundi" runat="server">
        </asp:DropDownList>
    </div>
    <div style="float: left; width: 966px; margin-top: 10px;">
        日期：
        <input type="text" name="textfield2" id="datetxt" runat="server" onfocus="WdatePicker({skin:'blue'})"
            style="width: 100px; border: 1px solid #CCC; height: 15px;" />
    </div>
    <div style="float: left; width: 966px; margin-top: 10px;">
        航空单号：
        <input type="text" name="textfield2" id="figthno" runat="server" style="width: 200px;
            border: 1px solid #CCC; height: 15px;" />
    </div>
    <div style="float: left; width: 966px; margin-top: 10px;">
        目的地：
        <asp:DropDownList ID="selectmudidi" runat="server">
        </asp:DropDownList>
    </div>
    <div style="float: left; width: 966px; margin-top: 10px;">
        重量kg：
        <input type="text" name="textfield2" id="weightkg" runat="server" style="width: 100px;
            border: 1px solid #CCC; height: 15px;" />
    </div>
    <div style="float: left; width: 966px; margin-top: 10px;">
        重量lb：
        <input type="text" name="textfield2" id="weightlb" runat="server" style="width: 100px;
            border: 1px solid #CCC; height: 15px;" />
    </div>
    <div style="float: left; width: 966px; margin-top: 10px;">
        收入： $
        <input type="text" name="textfield2" id="shourutxt" runat="server" style="width: 200px;
            border: 1px solid #CCC; height: 15px;" />
    </div>
    <div style="float: left; width: 966px; margin-top: 10px;">
        航空运费： $
        <input type="text" name="textfield2" id="fightpay" runat="server" style="width: 200px;
            border: 1px solid #CCC; height: 15px;" />
    </div>
    <div style="float: left; width: 966px; margin-top: 10px;">
        国内运费： $
        <input type="text" name="textfield2" id="gupneipay" runat="server" style="width: 200px;
            border: 1px solid #CCC; height: 15px;" />
    </div>
    <div style="float: left; width: 966px; margin-top: 10px;">
        税/附加费： $
        <input type="text" name="textfield2" id="taxtxt" runat="server" style="width: 200px;
            border: 1px solid #CCC; height: 15px;" />
    </div>
    <div style="float: left; width: 966px; margin-top: 10px;">
        其它费用： $
        <input type="text" name="textfield2" id="otherpay" runat="server" style="width: 200px;
            border: 1px solid #CCC; height: 15px;" />
    </div>
    <div style="color: #606; font-weight: bold; float: left; width: 966px; margin-top: 20px;
        text-align: center;">
        <asp:ImageButton ID="savebtn" runat="server" ImageUrl="~/images/btn-save-record.gif"
            Width="128" Height="40" border="0" OnClick="savebtn_Click" />&nbsp;&nbsp;&nbsp;
        <asp:ImageButton ID="saveandadd" runat="server" ImageUrl="~/images/btn-save-addnew.gif"
            Width="190" Height="40" border="0" OnClick="saveandadd_Click" />
    </div>
    </form>
</body>
</html>
